<template>
    <div class="main">
       <el-card>
           <div slot="header">
                <el-breadcrumb separator="/">
                    <el-breadcrumb-item :to="{path:'/home'}" >首页</el-breadcrumb-item>
                    <el-breadcrumb-item>权限管理</el-breadcrumb-item>
                    <el-breadcrumb-item>权限列表</el-breadcrumb-item>
                </el-breadcrumb>
           </div>
           <!-- 表格区域 -->
           <!-- 列表格式 -->
           <div class="table-box">
                <el-table
                    :data="rightList"
                    border
                   
                    style="width: 100%">
                    <el-table-column type="index" label="序号"  align="center" width="100px"></el-table-column>
                    <el-table-column prop="id" label="ID"></el-table-column>
                    <el-table-column prop="authName" label="权限名称"></el-table-column>
                    <el-table-column prop="path" label="地址"></el-table-column>
                    <el-table-column prop="level" label="层级">
                        <template slot-scope="scope">
                            <el-tag type="danger" size="samll"  v-if="scope.row.level==0">一级</el-tag>
                            <el-tag type="primary" size="samll" v-if="scope.row.level==1">二级</el-tag>
                            <el-tag type="success" size="samll" v-if="scope.row.level==2">三级</el-tag>
                        </template>
                    </el-table-column>
                   
                </el-table>
           </div>
       </el-card>
    </div>
</template>
<script>
export default {
    data(){
        return {
            rightList:[]
        }
    },
    created(){
        this.getRightList()
    },
    methods:{
       async getRightList(){
           let {data:res} =await this.$axios.get('rights/list')
           if(res.meta.status!==200) return this.$message.error(res.meta.msg)
           console.log(res);
           this.rightList=res.data
           
        }
    }
}
</script>
<style lang="less">

</style>
